<template>
  <div style="display: flex;justify-content: space-between;" class="slot_template_box">
    <div style="padding-right: 15px;border-right: 1px solid #dcdfe6;padding-top: 20px;">
      <img :src="scriptItem.imgUrl" class="image">
      <!-- <div v-if="blockInfo.description" class="description">{{ blockInfo.description }}：</div> -->
      <div class="descriptionContent" style="word-break: normal;">
        {{blockInfo.description}}
      </div>
      <div v-if="scriptItem.descriptionOther" class="descriptionContent">{{scriptItem.descriptionOther}}</div>
      <ul v-if="scriptItem.introList">
        <li v-for="(item,index)  in scriptItem.introList" :key="index" class="descriptList">{{item}}</li>
      </ul>
    </div>
    <div style="width: 49rem;padding: 0 15px;" :class="scriptItem.layoutClass?scriptItem.layoutClass:''">
      <!-- <ScriptRender
        :labelPosition='labelPosition'
        :labelWidth='labelWidth'
        :showJson='scriptItem.formJson'
        :dataForm='dataForm'
        /> -->
        <slot name="layout"></slot>
    </div>
  </div>
</template>

<script>
import mixinTypeViewModule from '@/mixins/script-type-view-module'

export default {
  mixins: [mixinTypeViewModule],
  components: {
  },
  props: {
    blockInfo: {
      type: Object,
      default: () => { }
    },
    scriptItem: {
      type: Object,
      default: () => { }
    }
  },
  computed: {
    blocksList () {
      return this.scriptList()
    }
  },
  data () {
    return {
      labelPosition: 'left',
      labelWidth: 90,
      dataForms: {}
      // dataForms: {
      //   'radioSelect': {
      //     'selectId': '',
      //     'radioType': 'Dataset'
      //   },
      //   'filters': {
      //     'rules': [{
      //       'key': '',
      //       'opt': '',
      //       'type': 'text',
      //       'value': ''
      //     }
      //     ],
      //     'condition': 'and'
      //   },
      //   'type': '',
      //   'times': '',
      //   'EscalationNode': true,
      //   'sendTo': [{ 'to': '', 'templateId': '', 'trigged': '3', 'dateType': 'Day' }],
      //   'scheduleTemplate': {
      //     'dates': '',
      //     'times': '',
      //     'number': '',
      //     'cornstr': '',
      //     'dateValue': '4'
      //   },
      //   // select-template param
      //   'templateId': '',
      //   'frequency': 'once',
      //   'AlertNode': true,
      //   'toAddress': { 'key': '', 'source': 'lastNode' }
      // }
    }
  },
  beforeCreate () {
    this.$options.components.ScriptRender = () => import('@/components/script-render/index')
  },
  methods: {

  }
}
</script>

<style lang='scss'>
.slot_template_box{
  img{
    width: 260px;
    height: 140px;
  }
  >div:nth-child(1){
    width: 280px;
  }
  >div:nth-child(2){
    max-height: 580px;
    overflow-y: auto;
    .el-form--label-top{
      box-shadow: 0px 1px 0px 0px #F0F0F0;
      margin-left: 0;
      padding: 10px 0;
      margin-bottom: 1px;
      >div{
        margin-bottom: 0 !important;
      }
    }
    .el-form-item:nth-child(1){
      // margin-bottom: 15px !important;
    }
    .el-form-item:nth-child(1),.el-form-item:nth-child(2){
      // display: flex;
    }
    ::v-deep .el-form-item .el-form-item__label{
      // width: 90px;
      font-weight: bold;
      margin-bottom: 0 !important;
      padding: 0;
    }
    .el-form-item__content{
      flex:1;
      margin-left:0 !important;
    }
    .el-row{
      .el-col:nth-child(1),.el-col:nth-child(3){
        display: flex;
        padding-left: 0;
      }
      .el-col:nth-child(1){
        width: 32%;
      }
      .el-col:nth-child(2){
        width: 28%;
      }
      .el-col:nth-child(3){
        width: 32%;
      }
      .el-col:nth-child(1) span, .el-col:nth-child(3) span{
        width: auto !important;
        white-space: nowrap;
        padding-right: 5px;
      }
    }
    .viewButton{
      // padding-left: 90px;
    }
    .listCont{
      .el-form-item .el-form-item__label {
        width: 70px !important;
        font-weight: Normal;
      }
    }
    .filter{
      .el-card__body {
        padding: 10px 15px;
      }
    }
  }
  .description{
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
  }
  .descriptionContent{
    font-size: 14px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.75);
    line-height: 20px;
    margin-bottom: 20px;
    margin-top: 10px;
  }
  ul{
    padding-left: 20px;
    .descriptList{
      width: 234px;
      font-weight: 400;
      color: #404040;
      line-height: 20px;
    }
  }

}

</style>
